package com.aptech.domain.JPA;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Account entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCOUNT", schema = "dbo", catalog = "Blue_Pumpkin")
public class Account implements java.io.Serializable {

	// Fields

	private Integer accountId;
	private String username;
	private String password;
	private String email;
	private Timestamp createdDate;
	private String familyName;
	private String givenName;
	private Integer mobile;
	private Timestamp dob;
	private Integer isAdmin;
	private String authority;
	private Set<News> newses = new HashSet<News>(0);
	private Set<Topic> topics = new HashSet<Topic>(0);
	private Set<Faq> faqs = new HashSet<Faq>(0);
	private Set<EventRequest> eventRequests = new HashSet<EventRequest>(0);

	// Constructors

	/** default constructor */
	public Account() {
	}

	/** minimal constructor */
	public Account(Integer accountId, String authority) {
		this.accountId = accountId;
		this.authority = authority;
	}

	/** full constructor */
	public Account(Integer accountId, String username, String password,
			String email, Timestamp createdDate, String familyName,
			String givenName, Integer mobile, Timestamp dob, Integer isAdmin,
			String authority, Set<News> newses, Set<Topic> topics,
			Set<Faq> faqs, Set<EventRequest> eventRequests) {
		this.accountId = accountId;
		this.username = username;
		this.password = password;
		this.email = email;
		this.createdDate = createdDate;
		this.familyName = familyName;
		this.givenName = givenName;
		this.mobile = mobile;
		this.dob = dob;
		this.isAdmin = isAdmin;
		this.authority = authority;
		this.newses = newses;
		this.topics = topics;
		this.faqs = faqs;
		this.eventRequests = eventRequests;
	}

	// Property accessors
	@Id
	@Column(name = "ACCOUNT_ID", unique = true, nullable = false)
        @GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getAccountId() {
		return this.accountId;
	}

	public void setAccountId(Integer accountId) {
		this.accountId = accountId;
	}

	@Column(name = "USERNAME", length = 18)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "PASSWORD", length = 250)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "EMAIL", length = 250)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "CREATED_DATE", length = 23)
	public Timestamp getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Timestamp createdDate) {
		this.createdDate = createdDate;
	}

	@Column(name = "FAMILY_NAME", length = 50)
	public String getFamilyName() {
		return this.familyName;
	}

	public void setFamilyName(String familyName) {
		this.familyName = familyName;
	}

	@Column(name = "GIVEN_NAME", length = 50)
	public String getGivenName() {
		return this.givenName;
	}

	public void setGivenName(String givenName) {
		this.givenName = givenName;
	}

	@Column(name = "MOBILE")
	public Integer getMobile() {
		return this.mobile;
	}

	public void setMobile(Integer mobile) {
		this.mobile = mobile;
	}

	@Column(name = "DOB", length = 23)
	public Timestamp getDob() {
		return this.dob;
	}

	public void setDob(Timestamp dob) {
		this.dob = dob;
	}

	@Column(name = "IS_ADMIN")
	public Integer getIsAdmin() {
		return this.isAdmin;
	}

	public void setIsAdmin(Integer isAdmin) {
		this.isAdmin = isAdmin;
	}

	@Column(name = "AUTHORITY", nullable = false, length = 50)
	public String getAuthority() {
		return this.authority;
	}

	public void setAuthority(String authority) {
		this.authority = authority;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
	public Set<News> getNewses() {
		return this.newses;
	}

	public void setNewses(Set<News> newses) {
		this.newses = newses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
	public Set<Topic> getTopics() {
		return this.topics;
	}

	public void setTopics(Set<Topic> topics) {
		this.topics = topics;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
	public Set<Faq> getFaqs() {
		return this.faqs;
	}

	public void setFaqs(Set<Faq> faqs) {
		this.faqs = faqs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
	public Set<EventRequest> getEventRequests() {
		return this.eventRequests;
	}

	public void setEventRequests(Set<EventRequest> eventRequests) {
		this.eventRequests = eventRequests;
	}

}